<div class="page-header">
    <h1>
        Profile
        <small>
            <i class="icon-double-angle-right"></i>
            Edit Profile
        </small>
    </h1>
</div>

<?php

if ($this->msg != "") {
    ?>
    <div class="alert alert-info">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>

        <strong>
            <i class="icon-ok"></i>
        </strong>

        <?php echo $this->msg; ?>
        <br />
    </div>
    <?php
}
if ($this->errmsg != "") {
    ?>
    <div class="alert alert-danger">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>

        <strong>
            <i class="icon-remove"></i>

        </strong>

        <?php echo $this->errmsg; ?>
        <br />
    </div>
<?php
}
?>

    <div class="row">
        <div class="col-xs-11">
            <form id="formAdd" class="form-horizontal" role="form" action="" method="post">
                
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="contact_name"> Name </label>

                    <div class="col-sm-9">
                            <input type="hidden" id="contact_id" name="contact_id" value="<?php if (isset($this->data['contact_id'])) { echo $this->data['contact_id']; } ?>"/>
                            <input type="text" id="contact_name" name="contact_name" placeholder="Name" class="col-xs-10 col-sm-5" value="<?php if (isset( $this->data['contact_name'] )) { echo $this->data['contact_name'];} ?>" required />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="family_name"> Father / Spouse Name </label>

                    <div class="col-sm-9">
                            <input type="hidden" id="family_id" name="family_id" value="<?php if (isset($this->data['family_id'])) { echo $this->data['family_id']; } ?>"/>
                            <input type="text" id="family_name" name="family_name" placeholder="Father / Spouse Name" class="col-xs-10 col-sm-5" value="<?php if (isset( $this->data['family_name'] )) { echo $this->data['family_name'];} ?>" required />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="birth_dat"> Date of Birth </label>
                    <div class="col-sm-4">
                        <div class="input-group">
                        <input class="form-control date-picker" id="birth_dat" name="birth_dat" type="text" data-date-format="yyyy-mm-dd" placeholder="yyyy-mm-dd" value="<?php if (isset( $this->data['birth_dat'] )) { echo $this->data['birth_dat'];} ?>" required />
                            <span class="input-group-addon">
                                    <i class="icon-calendar bigger-110"></i>
                            </span>
                        </div>
                    </div>
                    
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="gender"> Gender </label>

                    <div class="col-sm-9">
                        <select class="col-sm-5 chosen-select" id="gender" name="gender" required>
                            <option value="Male" <?php if (isset($this->data['gender']) && $this->data['gender'] == "Male") echo "selected"; ?>>Male</option>
                            <option value="Female" <?php if (isset($this->data['gender']) && $this->data['gender'] == "Female") echo "selected"; ?>>Female</option>

                        </select>
                            
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="marital_status"> Marital Status </label>
                    <div class="col-sm-9 radio">
                   
                            <label>
                                <input name="marital_status" id="marital_status" type="radio" class="ace" value="Single" <?php if (isset( $this->data['marital_status'] ) && $this->data['marital_status'] == "Single") { echo "checked";} ?> />
                                    <span class="lbl"> Single </span>
                            </label>
                        &nbsp;&nbsp;&nbsp;
                            <label>
                                <input name="marital_status" id="marital_status" type="radio" class="ace" value="Married" <?php if (isset( $this->data['marital_status'] ) && $this->data['marital_status'] == "Married") { echo "checked";} ?> />
                                    <span class="lbl"> Married </span>
                            </label>
                    
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="bank_acc_name">Phone </label>
                    <div class="col-sm-9">
                        <input type="text" id="contact_phone" name="contact_phone" placeholder="Phone" class="col-xs-10 col-sm-5" value="<?php if (isset( $this->data['contact_phone'] )) { echo $this->data['contact_phone'];} ?>" required />
                </div>

            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="name"> Mobile </label>

                <div class="col-sm-9">
                    <input type="text" id="contact_mobile" name="contact_mobile" placeholder="Mobile" class="col-xs-10 col-sm-5" value="<?php if (isset($this->data['contact_mobile'])) { echo $this->data['contact_mobile']; } ?>" required />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="bank_acc_no"> Email </label>

                <div class="col-sm-9">
                    <input type="text" id="contact_email" name="contact_email" placeholder="Email" class="col-xs-10 col-sm-5" value="<?php if (isset( $this->data['contact_email'] )) { echo $this->data['contact_email'];} ?>" required />
                </div>
            </div>            
            <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="name"> Address </label>

                    <div class="col-sm-4">
                        <textarea id="contact_address" name="contact_address" class="autosize-transition form-control" placeholder="Address" required><?php if (isset( $this->data['contact_address'] )) { echo $this->data['contact_address'];} ?></textarea>                        
                    </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="name"> City </label>

                <div class="col-sm-9">
                    <input type="text" id="contact_city" name="contact_city" placeholder="Kota" class="col-xs-10 col-sm-5" value="<?php if (isset($this->data['contact_city'])) { echo $this->data['contact_city']; } ?>" required />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="name"> Province </label>

                <div class="col-sm-9">
                    <input type="text" id="contact_province" name="contact_province" placeholder="Province" class="col-xs-10 col-sm-5" value="<?php if (isset($this->data['contact_province'])) { echo $this->data['contact_province']; } ?>" required />
                </div>
            </div>
            <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="bank_id"> Country </label>

                    <div class="col-sm-9">                           
                        <select class="col-sm-5 chosen-select" id="country_id" name="country_id" data-placeholder="Choose a Country...">
                            <option value="">&nbsp;</option>

                            <?php
                            for ($x=0; $x<count($this->countryList); $x++){

                                $sel = "";
                                if ($this->countryList[$x]["code"] == $this->data['country_id']) $sel = "selected";

                                echo "<option value='".$this->countryList[$x]["code"]."' $sel>".$this->countryList[$x]["name"]."</option>\n";
                            }
                            ?>

                        </select>
                    </div>
                </div>
               
            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-success" type="submit">
                        <i class="icon-ok bigger-110"></i>
                        Submit
                    </button>

                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="icon-undo bigger-110"></i>
                        Reset
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>
